home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / ticker2.zip / scripts / netlog.cmd < prev    next >
OS/2 REXX Batch file  |  1996-05-15  |  2KB  |  55 lines

  1. /* script to get Messages from 'net send' */
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6. msgfile = SysIni('ticker.ini', 'NETLOG', 'MLOG_MSGFILE')
  7.  
  8. if ((msgfile = 'FEHLER:') | (msgfile = 'ERROR:')) then 
  9.   do
  10.     /* search for messagefile in all local drives */
  11.     msgfile = ''
  12.     drives = SysDriveMap(,'LOCAL')
  13.     do words(drives)
  14.       parse var drives adrive drives
  15.       call SysFileTree adrive'\messages.log', 'found', 'FSO'
  16.       if (found.0 > 0) then 
  17.       do
  18.         msgfile = found.1
  19.         /* save found messagefilename in ini for next time */
  20.         SysIni('ticker.ini', 'NETLOG', 'MLOG_MSGFILE', msgfile)
  21.         leave
  22.       end
  23.     end
  24.   end
  25.  
  26. linenr = SysIni('ticker.ini', 'NETLOG', 'MLOG_LINENR')
  27. if ((linenr = 'FEHLER:') | (linenr = 'ERROR:')) then linenr = 1
  28.  
  29. firstline = SysIni('ticker.ini', 'NETLOG', 'MLOG_FIRSTLINE')
  30. if ((firstline = 'FEHLER:') | (firstline = 'ERROR:')) then firstline = 'NOT AVAILABLE'
  31.  
  32. actline = 0
  33.  
  34. do while lines(msgfile) 
  35.   actline = actline + 1; 
  36.   
  37.   aline = linein(msgfile)
  38.  
  39.   /* check if messagefile was deleted since last read by this script */
  40.  
  41.   if ((actline = 0) & (\(aline = firstline))) then 
  42.     linenr = 0
  43.  
  44.   /* check if message should be shown and then show it for 5 minutes */
  45.   if ( \(linenr > actline) ) then
  46.   do
  47.     call addTicker ' 'aline' ', 'MLOG'actline, 300, red
  48.   end
  49. end
  50.  
  51. linenr = SysIni('ticker.ini', 'NETLOG', 'MLOG_LINENR', actline)
  52. firstline = SysIni('ticker.ini', 'NETLOG', 'MLOG_FIRSTLINE', firstline)
  53.  
  54. exit
  55.